package com.lyy.polymorphic.polyparameter;


/**
 * @Author:  GZQ
 * @date:  2024/11/20 22:03
 * @description: 多态参数案例 - 员工类
 */

public class Employee { // 父类

    private String name;
    private double salary;

    public Employee(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    // 计算年工资
    public double getAnnual() {
        return salary * 12;
    }
}
